﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Game
{
    public class Menu : Dialog
    {
        public override bool Init(ContentManager Content, int n, string strResource, int nframe, int dframe)
        {
            _nSprite = 1;
            _Sprite = new MySprite[_nSprite];
            Texture2D texture2D;
            //Texture2D[] texture2D;

            //texture2D = new Texture2D[n];
            //for (int i = 0; i < n; i++)
            //    texture2D[i] = Content.Load<Texture2D>(@"OnePiece/" + strResource+i.ToString("00"));
            texture2D = Content.Load<Texture2D>(@"Menu/" + strResource);

            // int nframe = 10;
            // int dframe = 15;
            _Sprite[0] = new MySprite(texture2D, nframe, dframe, 100.0f, 100.0f);

            return true;
        }
        public override Window Clone()
        {
            Window newObject = new Menu();
            newObject._nSprite = this._nSprite;
            newObject._Sprite = new MySprite[this._nSprite];
            for (int i = 0; i < this._nSprite; i++)
            {
                newObject._Sprite[i] = new MySprite(this._Sprite[i].texture2d, this._Sprite[i].nFrame, this._Sprite[i].dFrame, X, Y);
            }
            newObject.X = this.X;
            newObject.Y = this.Y;

            return newObject;
        }
    }
}
